package com.campus.common.message;

import com.campus.common.vo.Book;
import com.campus.common.vo.BorrowRecord;

import java.io.Serializable;
import java.util.List;

public class LibraryResponse extends BaseMessage implements Serializable {
    private boolean success;
    private String message;
    private List<Book> books;
    private List<String> borrowers;
    private List<BorrowRecord> borrowRecords;  // 新增字段
    private static final long serialVersionUID = 1L;
    public LibraryResponse() {}

    public LibraryResponse(boolean success, String message, List<Book> books) {
        this.success = success;
        this.message = message;
        this.books = books;
    }

    public LibraryResponse(boolean success, String message, List<String> borrowers, int flag) {
        this.success = success;
        this.message = message;
        this.borrowers = borrowers;
    }

    // 新增构造函数
    public LibraryResponse(boolean success, String message, List<BorrowRecord> borrowRecords,boolean flag) {
        this.success = success;
        this.message = message;
        this.borrowRecords = borrowRecords;
    }

    public boolean isSuccess() { return success; }
    public String getMessage() { return message; }
    public List<Book> getBooks() { return books; }

    public List<BorrowRecord> getBorrowRecords() { return borrowRecords; }  // 新增Getter

    public void setBorrowers(List<String> borrowers) {
        this.borrowers = borrowers;
    }
    public void setBorrowRecords(List<BorrowRecord> borrowRecords) {
        this.borrowRecords = borrowRecords;
    }

    public List<String> getBorrowers() {
        return borrowers;
    }
}